package org.fatmansoft.teach.service;

import org.fatmansoft.teach.models.Person;
import org.fatmansoft.teach.models.Other;
import org.fatmansoft.teach.util.ComDataUtil;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;
@Service
public class OtherService {
    public Map getMapFromOther(Other s) {
        Map m = new HashMap();
        Person p;
        if(s == null)
            return m;
        m.put("primarySchool",s.getPrimarySchool());
        m.put("junior",s.getJunior());
        m.put("senior",s.getSenior());
        p = s.getPerson();
        if(p == null)
            return m;
        m.put("otherId", s.getOtherId());
        m.put("personId", p.getPersonId());
        m.put("name",p.getName());
        m.put("num",p.getNum());
        return m;
    }
}
